package com.yangye.springclouddemomqtt.model;

import lombok.Getter;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

/**
 * 发送给设备的消息体父类
 * 需要转化为string
 */
@Getter
@Setter
@Slf4j
public class BaseOutCommand<T> {
    //指令header
    // "header":{
    //    "cmd":xxxx
    // }
    protected OutCommandHeader header;

    /**
     * mqtt消息体
     */
    protected T data;

    public BaseOutCommand(int cmd, String deviceCode) {
        OutCommandHeader header = new OutCommandHeader();
        header.setCmd(cmd);
        header.setDeviceCode(deviceCode);
        this.header = header;
    }
}
